package AbstractFactory;

import AbstractFactory.Circle.Shape;
import AbstractFactory.Color.Blue;
import AbstractFactory.Color.Color;
import AbstractFactory.Color.Green;
import AbstractFactory.Color.Red;

/**
 * @Author: zhaojie
 * @Date: Created in 9:55 2018/6/26
 * @Description: 创建扩展了 AbstractFactory 的工厂类，基于给定的信息生成实体类的对象。
 */
public class ColorFactory extends AbstractFactory  {
    @Override
    public Color getColor(String colorType) {
        if(colorType==null){
            return null;
        }else if(colorType.equalsIgnoreCase("BLUE")){
            return new Blue();
        }else if(colorType.equalsIgnoreCase("Red")){
            return new Red();
        }else if(colorType.equalsIgnoreCase("Green")){
            return new Green();
        }
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        return null;
    }
}
